const express = require('express')
const router = express.Router()

// 导入User路由处理函数的模块   路由接口和路由处理函数分开，解耦
const userHandle = require('../router_handler/user')
// 导入验证表单的包
const expressJoi = require('@escook/express-joi')
// 导入验证规则对象
const { reg_login_schema } = require('../schema/user')

// 注册用户  请求路径 验证中间件 处理函数
router.post('/reguser', expressJoi(reg_login_schema), userHandle.regUser)
// 登录
router.post('/login', expressJoi(reg_login_schema), userHandle.login)

module.exports = router